<!DOCTYPE html>  
<html>  
<head>  
<meta charset=UTF-8">  

<title>html5测试</title>  
  
<script type="text/javascript">  
var images=['img/jiugongge/4','img/jiugongge/2','img/jiugongge/3'];
var url=images[Math.floor(Math.random()*images.length)];
console.log(url);
</script>  
  
<body>  
    <img src="img/jiugongge/1.png">  
</body>  
</html>  